﻿@model IEnumerable<Uco.Models.GalleryBanner>
@using Telerik.Web.Mvc.UI;
@using Telerik.Web.Mvc;

@{
    ViewBag.Title = "Index";
    Layout = "~/Areas/Admin/Views/Shared/_LayoutNoTree.cshtml";
}

<h2>באנרים</h2>

@(Html.Telerik().Grid<Uco.Models.GalleryBanner>()
    .Name("Ajax_Grid")
        .DataKeys(keys =>
        {
            keys.Add(r => r.ID);
        })
        .DataBinding(dataBinding =>
        {
            dataBinding.Ajax()
                .Select("_AjaxIndex", "GalleryBanner")
                .Delete("_AjaxDelete", "GalleryBanner");
        })
        .Columns(columns =>
        {
            columns.Bound(r => r.Title);
            columns.Command(commands =>
            {
                commands.Custom("Edit").Text("עריכה").DataRouteValues(route => route.Add(r => r.ID).RouteKey("ID")).Action("Edit", "GalleryBanner");
                commands.Delete();
            }).Width(210).Title("פקודות");
        })
        .Pageable()
        .Sortable()
        .Filterable()
        .Groupable()
)
<br />
@Html.ActionLink("חדש", "Create", "GalleryBanner", null, new { @class = "t-button t-state-default" })


